package com.whalehearing.tingyou.common.utils;

/**
 * Redis所有系统配置的Key添加前缀
 *
 */
public class RedisKeys {

    public static String getSysConfigKey(String key){
        return "sys:config:" + key;
    }

    /* *
     * 产品信息
     *
     * @return java.lang.String
     * @author shensh
     * @create 2024/10/16
     **/
    public static String getSpuListKey(){
        return "spu:list:";
    }

    /**
     * 帖子(文章)收藏量缓存
     * @param postId 帖子ID
     * @return 缓存key
     */
    public static String getPostCollectKey(Integer postId){
        return "post:collect:" + postId;
    }

    /* *
     * 门店和产品帖子(文章)点赞
     * @param postId
     * @return java.lang.String
     * @author shensh
     * @create 2024/10/16
     **/
    public static String getStoreSpuPostKey(Integer postId){
        return "storeSpu:post:info:" + postId;
    }

    public static String getTopicKey(Integer topicId){
        return "topic:info:" + topicId;
    }

    /**
     * 粉丝关注量缓存
     * @param uid 用户ID
     * @return 缓存key
     */
    public static String getUserKey(Integer uid){
        return "user:info:" + uid;
    }

    /**
     * 用户登录信息缓存
     * @param uid 用户ID
     * @return 缓存key
     */
    public static String getUserCacheKey(Integer uid){
        return "userId:" + uid;
    }
}
